import os
import sys

if len(sys.argv) != 2:
    print 'Usage: t-pystep1.py <stepmodule>'
    sys.exit(-1)

sys.path = ['./scripts/pystep1'] + sys.path

def my_exit(code):
    print "FATAL! sys.exit() called"
    raise RuntimeError

sys.exit = my_exit

bindir = os.getcwd() + '/bindir'
fromdir = os.getcwd() + '/tmp/root.step0'
todir = os.getcwd() + '/tmp/root.step1'

print sys.path
mod = __import__(sys.argv[1])
mod.select(bindir, fromdir, todir)

